package com.example.controller;

import com.example.domain.customer.entity.CustomerEventLog;
import com.example.service.customer.cache.CustomerEventLogCacheService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

/**
 * @Description 缓存测试
 * @Author Bing
 * @Date 2025/1/21 14:36
 */
@RestController
@RequestMapping("test")
public class CacheTestController {

    @Resource
    private CustomerEventLogCacheService customerEventLogCacheService;

    @GetMapping("get1")
    public CustomerEventLog get1(Long id){
        return customerEventLogCacheService.getById(id);
    }

    @GetMapping("get2")
    public CustomerEventLog get2(Long id){
        return customerEventLogCacheService.getById2(id,"test");
    }

    @GetMapping("get3")
    public CustomerEventLog get3(Long id){
        return customerEventLogCacheService.getById3(id,"test");
    }

    @GetMapping("get4")
    public CustomerEventLog get4(Long id){
        return customerEventLogCacheService.getById4(id,"test",1L);
    }
}